<?php
/*
  $Id: popup_image.php,v 1.3 2005/08/18 13:06:35 mwithington Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
  ECJC1.1.6 Ready
*/

  // -- webMS Modification --
  // Ensure a valid runtime environment or die
  if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );

  // -- webMS Modification --
  // Check if osCommerce environment is already loaded
  if (defined( '_OSCOMMERCE_LOADED' )) {
    if (!DB_SHARED) {
      // Reconnect to osCommerce Database
      tep_db_connect() or die('Unable to connect to database server!');
    }
    // Load osCommerce Globals for Boxes
    global $category_links, $languages_id, $catID, $catID_array, $current_category_id;
    global $request_type, $lng, $cart, $currencies, $language, $navigation, $breadcrumb;
  } else {
    // Load osCommerce Environment for the First Time
    require('components/'.$option.'/includes/application_top.php');
  }

  // require(DIR_WS_LANGUAGES . $language . '/' . $osMod . '.php');

  $navigation->remove_current_page();

  $products_query = tep_db_query("select pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$_REQUEST['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");
  $products = tep_db_fetch_array($products_query);

// Include the Stylesheet for osCommerce
global $mosConfig_live_site;
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML <?php echo HTML_PARAMS; ?>>
<HEAD>
<TITLE><?php echo $products_values['products_name']; ?></TITLE>

<link rel="stylesheet" type="text/css" href="<?php echo $mosConfig_live_site ?>/components/com_oscommerce/stylesheet.css">
<script language="javascript"><!--
var i=0;
function resize() {
  if (navigator.appName == 'Netscape') i=40;
  if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
  self.focus();
}
//--></SCRIPT>
</HEAD>
<BODY onLoad="resize();">
<?php

//BOF:Customer Add product

               if (is_file(DIR_WS_IMAGES ."thumb/".$products['products_image'])){$temp="thumb/";}else{$temp=NULL;}
               echo tep_image(DIR_WS_IMAGES .$temp. $products['products_image'], $products['products_name']);
               //EOF:Customer add product

  require(DIR_WS_INCLUDES . 'application_bottom.php');

  // -- webMS Modification --
  // reset the Mambo Database connection (stomped by osCommerce Connection)
  if (!DB_SHARED) {
    global $database, $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix;
    $database = new database( $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix );
  }
 ?>
